﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

namespace gcmp
{
    /// 几何错误通用类型
    enum class GeometryErrorCode : int32_t
    {
        Unknown = -1, ///< 未知错误
        Success = 0, ///< 默认成功
        Failed = 1, ///< 通用错误
        NullPtr = 2, ///< 指针为空
        DegenerateCurve = 3, ///< 退化的曲线
        DegenerateSegment = 4, ///< 退化的段
        DontSupport = 5, ///< 不支持
        BadArgument = 6, ///< 错误输入
        Invalid = 7, ///< 无效的结果
        DataDestroyed = 8, ///< 数据毁坏
        EmptyBody = 9, ///< 实体为空
        IsSheet = 10, ///< 壳体错误
        NotCoplane = 11, ///< 不共面
        NotClosed = 12, ///< 不封闭
        NonPeriodic = 13 ///< 非周期
    };


    /// \brief 缝合错误码类型
    enum class StitchErrorCode : int32_t
    {
        Unknown = -1,             ///< 未知错误
        Success = 0,              ///< 缝合成功        
        EmptyInput = 1,           ///< 输入数据为空
        SingleFaceInput = 2,       ///< 输入为单张Face
        EmptyFace = 3,            ///< 输入的face或face.surface()为空
        HasShortEdge = 4,         ///< 存在长度小于缝合容差的短边
        SingleBodyInput = 5,      ///< 输入为单个BrepBody
        CreatSheetFalse = 6,      ///< 造壳失败
        BuildTopologyFalse = 7,   ///< 重合处构建拓扑失败
        ResultBodyInvalid = 8,    ///< 结果体不合法
        ResultBodyLargeEpsilon = 9,///< 结果体容差大
        ReversedFailed = 10,       ///< 朝向翻转失败
    };

    /// \brief 倒圆/直角通用错误码
    enum class BlendErrorCode : int32_t
    {
        Unknown = -1, ///< 倒角未知错误
        Success = 0, ///< 倒角成功
        BodyNull = 1, ///< 输入的体为空
        BodyInvalid = 2, ///< 输入的体非法
        NotInSameBody = 3, ///< 所选多条要倒角的边不在同一个体上
        FixWrongBody = 4, ///< 对不支持的体做倒角
        EdgeListEmpty = 5, ///< 需要倒角的边列表为空
        InputNotEdge = 6, ///< 输入参数的拓扑类型不是边
        AttributeError = 7, ///< 属性错误
        CannotHandleMoreThanThreeEdges = 8, ///< 不支持三边以上共顶点倒角
        EdgeIsLaminar = 9,///< 不支持laminar类型的边
        EdgeNull = 10, ///< 边为空
        EdgeBadTopol = 11, ///< 不合法的拓扑
        EdgeWithoutBlendAttrib = 12, ///< 边缺少倒角属性
        EdgeWithBadBlendAttrib = 13, ///< 边的倒角属性不全
        EdgeNotInBody = 14, ///< 输入的边不在当前体中
        EdgeCannotHandle = 15, ///< 无法处理的边
        EdgeBadInpunt = 16, ///< 输入的边不合法
        FaceNull = 17, ///< 输入空面
        BadRadius = 18, ///< 不合法的倒圆角半径
        SpringCurveNull = 19, ///< SpringCurve为空
        CapcurveNull = 20, ///< CapCurve为空
        CapcurveIntersect = 21, ///< 存在边截断了capCurve
        CapcurveCalculateFailure = 22, ///< CapCurve计算失败
        BoundcurveNull = 23, ///< 边界曲线为空
        BlendSurfaceNull = 24, ///< BlendSurface(倒角生成的Surface)为空
        IntersectFailure = 25, ///< 求交失败
        IntervalCalculateFailure = 26, ///< 倒角相关曲线的区间计算失败
        CannotCreateBlendSurface = 27, ///< 无法创建BlendSurface
        BlendSheetNull = 28, ///< BlendSheet(倒角生成的Sheet)为空
        CannotCreateBlendSheet = 29, ///< 无法创建BlendSheet
        BlendSheetInvalid = 30, ///< BlendSheet不合法
        ImprintFailure = 31, ///< 刻印失败
        FixFailure = 32, ///< 固定倒角失败
        NullPtr = 33, ///< 空指针
        BadInput = 34, ///< 输入的参数不合法
        InputNotFace = 35, ///< 输入参数的拓扑类型不是面
        EmptyFaceList = 36, ///< 不等距倒角的固定面列表为空
        LackFirstFace = 37, ///< 不等距倒角输入的固定面列表与边列表不匹配
        BadRange = 38, ///< 等距或不等距倒角的倒角距离不合法
        NotEqualChamfer = 39 ///< 三边共顶点倒角创建过渡面必须是等距倒角模式
    };
}
